﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Com.JunCaiSoft.Freeze.Model
{
    public class UnFreezeMoneyItem
    {
        /// <summary>
        /// 冻结资金标识
        /// </summary>
        public virtual Guid Id { get; set; }
        /// <summary>
        /// 冻结序号
        /// </summary>
        public virtual Int64 Num { get; set; }
        /// <summary>
        /// 冻结编码
        /// </summary>
        public virtual String NumCode { get; set; }
        /// <summary>
        /// 项目所属分公司
        /// </summary>
        public virtual String BranchCompany { get; set; }
        /// <summary>
        /// 分公司负责人
        /// </summary>
        public virtual String BranchBoss { get; set; }
        /// <summary>
        /// 涉案项目老板
        /// </summary>
        public virtual String ProjectManager { get; set; }
        /// <summary>
        /// 项目老板身份证
        /// </summary>
        public virtual String ProjectManagerID { get; set; }
        /// <summary>
        /// 冻结利率
        /// </summary>
        public virtual Double Rate { get; set; }
        /// <summary>
        /// 冻结利率周期（日利率、月利率、年利率）
        /// </summary>
        public virtual Double RatePeriod { get; set; }
        /// <summary>
        /// 冻结项目
        /// </summary>
        public virtual String FreezeProject { get; set; }
        /// <summary>
        /// 冻结银行
        /// </summary>
        public virtual String FreezeBank { get; set; }
        /// <summary>
        /// 冻结银行账户
        /// </summary>
        public virtual String BankAccount { get; set; }
        /// <summary>
        /// 冻结账户尾号
        /// </summary>
        public virtual String AccountTail 
        { 
            get
            {
                return BankAccount.Substring(BankAccount.Length - 4, 4);
            } 
        }
        /// <summary>
        /// 执行案号
        /// </summary>
        public virtual String CaseCode { get; set; }
        /// <summary>
        /// 案件状态
        /// </summary>
        public virtual String CaseStatus { get; set; }
        /// <summary>
        /// 实际冻结
        /// </summary>
        public virtual Double FactFreeze { get; set; }
        /// <summary>
        /// 冻结资金（总数）
        /// </summary>
        public virtual Double FreezeMoney { get; set; }
        /// <summary>
        /// 解冻金额
        /// </summary>
        public virtual Double UnFreezeMoney { get; set; }
        /// <summary>
        /// 冻结余额
        /// </summary>
        public virtual Double FreezeBalance { get; set; }
        /// <summary>
        /// 款项类型
        /// </summary>
        public virtual String FundsType { get; set; }
        /// <summary>
        /// 冻结时间
        /// </summary>
        public virtual String FreezeTime { get; set; }
        /// <summary>
        /// 解冻时间
        /// </summary>
        public virtual String UnFreezeTime { get; set; }
        /// <summary>
        /// 冻结天数
        /// </summary>
        public virtual Int32 FreezeDayCount
        {
            get
            {
                return ((UnFreezeTime == DateTime.MaxValue.ToString("yyyy-MM-dd") ||
                           UnFreezeTime == DateTime.MaxValue.AddDays(-1).ToString("yyyy-MM-dd") ? DateTime.Now : DateTime.Parse(UnFreezeTime)) - DateTime.Parse(FreezeTime)).Days;
            }
        }
        public virtual Double FreezeIntrest
        {
            get
            {
                return UnFreezeMoney * Rate;
            }
        }
        /// <summary>
        /// 冻结确认
        /// </summary>
        public virtual Boolean FreezeLoanConfirm { get; set; }
        /// <summary>
        /// 解冻操作人
        /// </summary>
        public virtual String RealName { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public virtual String CreateTime { get; set; }
    }
}
